import React,{Component} from 'react';
import './RadioGroup.less';

class ContainerItem extends Component{
    constructor(props){
        super(props);
        this.state={}
    }

    /**
     * 重新渲染子组件
     */
    renderChildren(){
        return React.Children.map(this.props.children,(child)=>{
            return React.cloneElement(child,{
                name:this.props.name
            })
        })
    }
    render() {
        return(
            <div className={'radioGroup'}>
                {
                    this.renderChildren()
                }
            </div>
        )
    }
}

export default ContainerItem;
